<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>MCUXpresso SDK API Reference Manual: UART FreeRTOS Driver</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="fs_logo.gif"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">MCUXpresso SDK API Reference Manual
   &#160;<span id="projectnumber">Rev. 0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__uart__freertos__driver.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a>  </div>
  <div class="headertitle">
<div class="title">UART FreeRTOS Driver<div class="ingroups"><a class="el" href="group__uart.html">UART: Universal Asynchronous Receiver/Transmitter Driver</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structuart__rtos__config__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#structuart__rtos__config__t">uart_rtos_config_t</a></td></tr>
<tr class="memdesc:structuart__rtos__config__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART configuration structure.  <a href="group__uart__freertos__driver.html#structuart__rtos__config__t">More...</a><br/></td></tr>
<tr class="separator:structuart__rtos__config__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
UART RTOS Operation</h2></td></tr>
<tr class="memitem:ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d">UART_RTOS_Init</a> (uart_rtos_handle_t *handle, uart_handle_t *t_handle, const <a class="el" href="group__uart__freertos__driver.html#structuart__rtos__config__t">uart_rtos_config_t</a> *cfg)</td></tr>
<tr class="memdesc:ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a UART instance for operation in RTOS.  <a href="#ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d">More...</a><br/></td></tr>
<tr class="separator:ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab7ac281cb85e1d290c8f25c83a6facfc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#gab7ac281cb85e1d290c8f25c83a6facfc">UART_RTOS_Deinit</a> (uart_rtos_handle_t *handle)</td></tr>
<tr class="memdesc:gab7ac281cb85e1d290c8f25c83a6facfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitializes a UART instance for operation.  <a href="#gab7ac281cb85e1d290c8f25c83a6facfc">More...</a><br/></td></tr>
<tr class="separator:gab7ac281cb85e1d290c8f25c83a6facfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
UART transactional Operation</h2></td></tr>
<tr class="memitem:gada4115d237b9517f2587a054dbdc442a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#gada4115d237b9517f2587a054dbdc442a">UART_RTOS_Send</a> (uart_rtos_handle_t *handle, const uint8_t *buffer, uint32_t length)</td></tr>
<tr class="memdesc:gada4115d237b9517f2587a054dbdc442a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends data in the background.  <a href="#gada4115d237b9517f2587a054dbdc442a">More...</a><br/></td></tr>
<tr class="separator:gada4115d237b9517f2587a054dbdc442a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa8adcb11232b565985f3f5961815a00c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#gaa8adcb11232b565985f3f5961815a00c">UART_RTOS_Receive</a> (uart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received)</td></tr>
<tr class="memdesc:gaa8adcb11232b565985f3f5961815a00c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receives data.  <a href="#gaa8adcb11232b565985f3f5961815a00c">More...</a><br/></td></tr>
<tr class="separator:gaa8adcb11232b565985f3f5961815a00c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structuart__rtos__config__t" id="structuart__rtos__config__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct uart_rtos_config_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"></div><table class="memberdecls">
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
<tr class="memitem:af93759d3503ab560aef347c02e5f42dd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af93759d3503ab560aef347c02e5f42dd"></a>
UART_Type *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#af93759d3503ab560aef347c02e5f42dd">base</a></td></tr>
<tr class="memdesc:af93759d3503ab560aef347c02e5f42dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART base address. <br/></td></tr>
<tr class="separator:af93759d3503ab560aef347c02e5f42dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa9ea3cb62d50a49b907b1baddbeeaa0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa9ea3cb62d50a49b907b1baddbeeaa0"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#aaa9ea3cb62d50a49b907b1baddbeeaa0">srcclk</a></td></tr>
<tr class="memdesc:aaa9ea3cb62d50a49b907b1baddbeeaa0"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART source clock in Hz. <br/></td></tr>
<tr class="separator:aaa9ea3cb62d50a49b907b1baddbeeaa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a516fb385a59c89720a3dead326df78"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a516fb385a59c89720a3dead326df78"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#a3a516fb385a59c89720a3dead326df78">baudrate</a></td></tr>
<tr class="memdesc:a3a516fb385a59c89720a3dead326df78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Desired communication speed. <br/></td></tr>
<tr class="separator:a3a516fb385a59c89720a3dead326df78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d8809aff183104892d30cc0734679bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d8809aff183104892d30cc0734679bd"></a>
<a class="el" href="group__uart__driver.html#ga436e5a7bdb5f24decb5bfb0c87a83ff4">uart_parity_mode_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#a8d8809aff183104892d30cc0734679bd">parity</a></td></tr>
<tr class="memdesc:a8d8809aff183104892d30cc0734679bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parity setting. <br/></td></tr>
<tr class="separator:a8d8809aff183104892d30cc0734679bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2afb208100058edfc05aa161e555483f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2afb208100058edfc05aa161e555483f"></a>
<a class="el" href="group__uart__driver.html#gaca4f14d23735c6afefb76cbee18e1db6">uart_stop_bit_count_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#a2afb208100058edfc05aa161e555483f">stopbits</a></td></tr>
<tr class="memdesc:a2afb208100058edfc05aa161e555483f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of stop bits to use. <br/></td></tr>
<tr class="separator:a2afb208100058edfc05aa161e555483f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad05b4abce6a95baa7ba35eaa57569cfe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad05b4abce6a95baa7ba35eaa57569cfe"></a>
uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#ad05b4abce6a95baa7ba35eaa57569cfe">buffer</a></td></tr>
<tr class="memdesc:ad05b4abce6a95baa7ba35eaa57569cfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Buffer for background reception. <br/></td></tr>
<tr class="separator:ad05b4abce6a95baa7ba35eaa57569cfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b7d6d667f6e06c720f506a07869e14d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b7d6d667f6e06c720f506a07869e14d"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart__freertos__driver.html#a7b7d6d667f6e06c720f506a07869e14d">buffer_size</a></td></tr>
<tr class="memdesc:a7b7d6d667f6e06c720f506a07869e14d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of buffer for background reception. <br/></td></tr>
<tr class="separator:a7b7d6d667f6e06c720f506a07869e14d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga1ca9d0f6b8d4d5fc3e64c9a57d7ada7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int UART_RTOS_Init </td>
          <td>(</td>
          <td class="paramtype">uart_rtos_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uart_handle_t *&#160;</td>
          <td class="paramname"><em>t_handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__uart__freertos__driver.html#structuart__rtos__config__t">uart_rtos_config_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>The RTOS UART handle, the pointer to an allocated space for RTOS context. </td></tr>
    <tr><td class="paramname">t_handle</td><td>The pointer to the allocated space to store the transactional layer internal state. </td></tr>
    <tr><td class="paramname">cfg</td><td>The pointer to the parameters required to configure the UART after initialization. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 succeed; otherwise fail. </dd></dl>

</div>
</div>
<a class="anchor" id="gab7ac281cb85e1d290c8f25c83a6facfc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int UART_RTOS_Deinit </td>
          <td>(</td>
          <td class="paramtype">uart_rtos_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function deinitializes the UART module, sets all register values to reset value, and frees the resources.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>The RTOS UART handle. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gada4115d237b9517f2587a054dbdc442a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int UART_RTOS_Send </td>
          <td>(</td>
          <td class="paramtype">uart_rtos_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sends data. It is a synchronous API. If the hardware buffer is full, the task is in the blocked state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>The RTOS UART handle. </td></tr>
    <tr><td class="paramname">buffer</td><td>The pointer to the buffer to send. </td></tr>
    <tr><td class="paramname">length</td><td>The number of bytes to send. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa8adcb11232b565985f3f5961815a00c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int UART_RTOS_Receive </td>
          <td>(</td>
          <td class="paramtype">uart_rtos_handle_t *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>received</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function receives data from UART. It is a synchronous API. If data is immediately available, it is returned immediately and the number of bytes received.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>The RTOS UART handle. </td></tr>
    <tr><td class="paramname">buffer</td><td>The pointer to the buffer to write received data. </td></tr>
    <tr><td class="paramname">length</td><td>The number of bytes to receive. </td></tr>
    <tr><td class="paramname">received</td><td>The pointer to a variable of size_t where the number of received data is filled. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
